# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=apulse
pkgver=0.1.13
pkgrel=0
pkgdesc="PulseAudio emulation for ALSA"
url="https://github.com/i-rinat/apulse"
arch="all"
license="MIT"
makedepends="cmake glib-dev alsa-lib-dev"
options="!check"  # no tests
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/i-rinat/apulse/archive/v$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="366385ae2304f7ff697ba70951d0753a5b1630310922e3763fd0813a73e0b4088b715135295aa2fa9111b8edcf91d82849dc31346b292b2e9db598bcdd47b007  apulse-0.1.13.tar.gz"
